using System.ComponentModel.DataAnnotations.Schema;

namespace Wips.Domain.Models.Authorities.Model
{
    /// <summary>
    /// 组织架构角色
    /// </summary>
    [Table("AuthorityOrganizationRoles")]
    [SugarTable("AuthorityOrganizationRoles", "组织架构角色")]
    public class OrganizationRole : ValueObjectBase
    {
        /// <summary>
        /// 组织架构ID
        /// </summary>
        public string OrganizationId { get; set; }

        /// <summary>
        /// 组织架构
        /// </summary>
        [Navigate(NavigateType.ManyToOne, nameof(OrganizationId))]
        public Organization Organization { get; set; }

        /// <summary>
        /// 角色ID
        /// </summary>
        public string RoleId { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        [Navigate(NavigateType.ManyToOne, nameof(RoleId))]
        public Role Role { get; set; }


        public OrganizationRole()
        {
        }

        public OrganizationRole(string organizationId, string roleId)
        {
            OrganizationId = organizationId;
            RoleId = roleId;
        }
    }
}